Skip to content

feat: add notifications command to CLI#8

Merged
sweetmantech merged 2 commits intomainfrom
sweetmantech/myc-4335-cli-notifications-add-command-to-the-cli-so-agents-can-send
Feb 25, 2026
Merged

feat: add notifications command to CLI#8
sweetmantech merged 2 commits intomainfrom
sweetmantech/myc-4335-cli-notifications-add-command-to-the-cli-so-agents-can-send

Conversation

@sweetmantech
Copy link
Copy Markdown
Contributor

@sweetmantech sweetmantech commented Feb 25, 2026

Summary

  • Adds recoup notifications command that wraps POST /api/notifications
  • Sends email notifications to the authenticated account's email address (auto-resolved from API key)
  • Supports --subject, --text, --html, --cc (repeatable), --room-id, and --json flags
  • Matches the documented interface at https://developers.recoupable.com/sdk#notifications

Test plan

  • 6 unit tests covering all flags and error handling
  • Full test suite passes (45 tests across 8 files)
  • Build succeeds
  • Manual testing with recoup notifications --subject "Test" --text "Hello"

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a notifications command to send notification emails with subject, optional text or HTML body, CC recipients, and room ID support.
    • Added JSON output option for machine-readable notification responses.
  • Tests

    • Added comprehensive test suite for the notifications command.
  • Chores

    • Added GitHub Actions workflow for automated testing on pull requests.

Adds `recoup notifications` command that wraps POST /api/notifications
to send email notifications to the authenticated account's email address.

Supports --subject, --text, --html, --cc (repeatable), --room-id, and --json flags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 25, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79de41b and f07e84b.

📒 Files selected for processing (4)
  • .github/workflows/test.yml
  • __tests__/commands/notifications.test.ts
  • src/bin.ts
  • src/commands/notifications.ts

📝 Walkthrough

Walkthrough

A new notifications CLI command is introduced, enabling users to send notification emails with configurable subject, body (text or HTML), CC recipients, and optional chat room linking. A GitHub Actions workflow is added to automate testing on pull requests to main.

Changes

Cohort / File(s) Summary
CI/CD Configuration
.github/workflows/test.yml
New GitHub Actions workflow for running tests and builds on PR to main. Sets up PNPM 9, Node.js 22, installs dependencies, and executes test and build commands.
Notifications Command
src/commands/notifications.ts, src/bin.ts
Adds a new notifications CLI command exported as notificationsCommand with options for subject, text/HTML body, repeatable CC recipients, room-id, and JSON output. Registers the command in the main CLI program.
Notifications Tests
__tests__/commands/notifications.test.ts
Comprehensive test suite verifying notification command behavior, including payload construction for various option combinations, JSON output formatting, error handling, and process exit codes.

Sequence Diagram

sequenceDiagram
    actor User as User
    participant CLI as CLI
    participant Client as HTTP Client
    participant API as API Server
    
    User->>CLI: pnpm notifications --subject "..." [options]
    activate CLI
    CLI->>CLI: Parse arguments & options
    CLI->>CLI: Build request body
    CLI->>Client: POST /api/notifications
    activate Client
    Client->>API: HTTP POST request
    activate API
    API-->>Client: Response (success/error)
    deactivate API
    deactivate Client
    alt Success
        CLI->>CLI: Format output (JSON or message)
        CLI-->>User: Display result
    else Error
        CLI->>CLI: Log error message
        CLI->>User: Exit with code 1
    end
    deactivate CLI
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hops of joy! A new command takes flight,
Notifications whispered through the night,
With subject, body, and recipients clear,
The workflow tests ensure quality sincere!
Emails now flutter from our CLI dear! ✨📧

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sweetmantech/myc-4335-cli-notifications-add-command-to-the-cli-so-agents-can-send

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Runs unit tests and build on all PRs targeting main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sweetmantech sweetmantech merged commit 1ca4daa into main Feb 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant